0) Setup

#libzzs---
library(ggplot2)
library(dplyr)
library(ggpubr)
library(car)
library(emmeans)
library(report)
library(DHARMa)
rm(list=ls())
set.seed(666) #Fix kernell

1) Import data & affect factors

setwd("/Users/martinmartin/Downloads/DATA/Github/Field")
sAll<-read.table("Field_G_A_P_activity.csv", sep="",header=T)
sA1<-sAll %>% filter(cond=="GC"|cond=="PC") %>% mutate(cond="CC")
sA2<-sAll %>% filter(cond!="GC"&cond!="PC")
sAll<-bind_rows(sA1,sA2)
sAll$cat<-as.factor(sAll$cat)
sAll$ID<-as.factor(sAll$ID)
sAll$cond<-as.factor(sAll$cond)
sAll$expe<-as.factor(sAll$expe)
levels(sAll$cond)
## [1] "A-" "A+" "AA" "CC" "G-" "G+" "P-" "P+"
c1<-"A 200\u00b5g/L"
c2<-"A 500\u00b5g/L"
c3<-"Control N°1"
c4<-"Control N°2"
c5<-"G 100\u00b5g/L"
c6<-"G 200\u00b5g/L"
c7<-"P 1mg/L"
c8<-"P 10mg/L"
levels(sAll$cond) <- c(c1,c2,c3,c4,c5,c6,c7,c8)
levels(sAll$cond)
## [1] "A 200µg/L"   "A 500µg/L"   "Control N°1" "Control N°2" "G 100µg/L"  
## [6] "G 200µg/L"   "P 1mg/L"     "P 10mg/L"
yo<-sAll %>% count(cond,ID)

sAll$cond<-factor(sAll$cond,levels=c("Control N°1",
                                 "A 200\u00b5g/L",
                                 "A 500\u00b5g/L",
                                 "Control N°2",
                                 "G 100\u00b5g/L",
                                 "G 200\u00b5g/L",
                                 "P 1mg/L","P 10mg/L"))
levels(sAll$cond)
## [1] "Control N°1" "A 200µg/L"   "A 500µg/L"   "Control N°2" "G 100µg/L"  
## [6] "G 200µg/L"   "P 1mg/L"     "P 10mg/L"

2) Create new variables

## Create second and min
T0<-sAll %>% 
  group_by(cond,ID) %>% 
  mutate(time=row_number()) %>%
  mutate(second=time*0.4) %>% 
  mutate(min=second/60) %>% 
  ungroup()

T0$cat<-as.factor(T0$cat)
T0$ID<-as.factor(T0$ID)
T0$cond<-as.factor(T0$cond)
T0$pck<-as.factor(T0$pck)
T0$expe<-as.factor(T0$expe)

## Create average speed variable
TaG<-T0 %>% 
  mutate(sec=round(sec,digits=0)) %>%
  group_by(cond,ID,sec) %>%
  summarise(absdY=sum(absdY,na.rm=T))
Ta2<-TaG %>% 
  group_by(cond,ID) %>%
  summarise(absdY=mean(absdY,na.rm=T))
m1<-glm(absdY~cond, data=Ta2)
ym1 <- predict(m1,type="link",se.fit=TRUE)
ydm1<-data.frame(ym1$fit,ym1$se.fit,Ta2$cond)
fm1<-ydm1 %>% rename(cond=Ta2.cond)
inm1<-family(m1)$linkinv

## Create Time spent moving by zone
dpos<-T0 %>% group_by(cond,ID) %>% 
  summarise(dpos=max(pos_y),
            size=mean(size,na.rm=T),
            pos_y=mean(pos_y))
dist<-mean(dpos$dpos,na.rm=T)
c<-dist/3
TZ<-T0 %>% 
  mutate(count=1) %>% 
  mutate(Zone = case_when(pos_y < c ~ "Top",
                          pos_y >= c & pos_y < 2*c ~ "Middle",
                          pos_y >= 2*c ~ "Bottom")) %>% 
  group_by(cond,Zone,ID) %>%
  summarise(count=sum(count,na.rm=T),
            absdY=mean(absdY,na.rm=T),
            size=mean(size,na.rm=T),
            pos_y=mean(pos_y)) %>% ungroup()
TZ1<-TZ %>% 
  group_by(cond,Zone) %>%
  summarise(count=mean(count,na.rm=T),
            absdY=mean(absdY,na.rm=T),
            size=mean(size,na.rm=T),
            pos_y=mean(pos_y))%>% ungroup()
TZA<-TZ1 %>%group_by(cond) %>%  mutate(spend=100*count/sum(count)) %>% ungroup()

## Create % Time spent moving
lim<-1
casef<-T0 %>% 
  group_by(cond,ID) %>% 
  mutate(mov = case_when(absdY < lim ~ 0,
                         absdY >= lim ~ 1)) %>% ungroup()
iltf<-casef %>% 
  group_by(cond,ID) %>% 
  summarise(umov=sum(mov,na.rm=T),
            n=n(),
            tmov=(umov/n)*100,
            sizem=max(size*45/400,na.rm=T),
            usize=mean(size*45/400,na.rm=T),
            pos_y=mean(pos_y)) %>% ungroup()

m2<-glm(tmov~cond, data=iltf)
ym2 <- predict(m2,type="link",se.fit=TRUE)
ydm2<-data.frame(ym2$fit,ym2$se.fit,iltf$cond)
fm2<-ydm2 %>% rename(cond=iltf.cond)
inm2<-family(m2)$linkinv

## Create number of diving events
TP<-T0 %>% 
  group_by(cond,ID) %>%
  summarise(plong=mean(plong,na.rm=T))

m3<-glm(plong~cond, data=TP)
ym3 <- predict(m3,type="link",se.fit=TRUE)
ydm3<-data.frame(ym3$fit,ym3$se.fit,TP$cond)
fm3<-ydm3 %>% rename(cond=TP.cond)
inm3<-family(m3)$linkinv

rm(casef,dpos,m1,m2,m3,TaG,TZ,TZ1,ydm1,ydm2,ydm3,ym1,ym2,ym3)

3) Plot ATRAZINE –> Figure S1

Ta3<-Ta2 %>% filter(cond==c1|cond==c2|cond==c3)
fm11<-fm1 %>% filter(cond==c1|cond==c2|cond==c3)
a<-ggplot(Ta3,aes(x=cond,y=absdY,group=cond,color=cond))+
  geom_point(alpha=0.8,size=2.5)+
  geom_pointrange(data=fm11,aes(x=cond,y=inm1(ym1.fit),
                               ymin=inm1(ym1.fit-1.96*ym1.se.fit),
                               ymax=inm1((ym1.fit+1.96*ym1.se.fit)),
                               group=cond,color=cond),size=2,linewidth=3)+
  

labs(y="Average speed (mm/sec)",x="")+
  theme_classic() +
  theme(plot.title = element_text(hjust = 0.5))+
  theme(plot.title = element_text(size=20,face = "bold"))+
  theme(axis.text=element_text(size=20,color="black"),
        axis.title=element_text(size=20,color="black"))+
  scale_color_manual(values=c("#54C6CC","#FFD966","#F0B33E","black"
                              ,"black","black","black","black"))+
  theme(legend.title = element_text(size=20),
        legend.text = element_text(size=20))+
  guides(colour=guide_legend(title="Species"))+
  theme(legend.position = "none",
        strip.text = element_text(size = 20))+
  stat_compare_means(comparisons = list(
    c(c3,c1),c(c3,c2)),
    aes(label = ..p.signif..),
    bracket.size = 1,size=5)

TZA3<-TZA %>% filter(cond==c1|cond==c2|cond==c3)

b<-ggplot(TZA3)+
  geom_point(aes(y=Zone,x=cond,size=spend,colour=cond))+
  theme_classic() +
  labs(y="Zones",x="")+
  theme(plot.title = element_text(hjust = 0.5))+
  theme(plot.title = element_text(size=20,face = "bold"))+
  theme(axis.text=element_text(size=20,color="black"),
        axis.title=element_text(size=20,color="black"))+
  scale_color_manual(values=c("#54C6CC","#FFD966","#F0B33E"))+
  theme(legend.title = element_text(size=20),
        legend.text = element_text(size=20))+
  guides(colour=guide_legend(title="Species"))+
  theme(strip.text = element_text(size = 20))+
  scale_size(range = c(.1, 30), name="% Time spent")+
  guides(color = FALSE)+
  theme(legend.position='none')


iltf3<-iltf %>% filter(cond==c1|cond==c2|cond==c3)
fm21<-fm2 %>% filter(cond==c1|cond==c2|cond==c3)

c<-ggplot(iltf3,aes(x=cond,y=tmov,group=cond,color=cond))+
  geom_point(alpha=0.8,size=2.5)+
  geom_pointrange(data=fm21,aes(x=cond,y=inm2(ym2.fit),
                               ymin=inm2(ym2.fit-1.96*ym2.se.fit),
                               ymax=inm2((ym2.fit+1.96*ym2.se.fit)),
                               group=cond,color=cond),size=2,linewidth=3)+
  theme_classic() +
  labs(y="Time spent moving (%)",x="")+
  theme(plot.title = element_text(hjust = 0.5))+
  theme(plot.title = element_text(size=20,face = "bold"))+
  theme(axis.text=element_text(size=20,color="black"),
        axis.title=element_text(size=20,color="black"))+
  scale_color_manual(values=c("#54C6CC","#FFD966","#F0B33E"))+
  theme(legend.title = element_text(size=20),
        legend.text = element_text(size=20))+
  guides(colour=guide_legend(title="Species"))+
  theme(legend.position = "none",
        strip.text = element_text(size = 20))+
  stat_compare_means(comparisons = list(
    c(c3,c1),c(c3,c2)),
    method.args = list(alternative = "greater"),
    aes(label = ..p.signif..),
    bracket.size = 1,size=5)

TP3<-TP %>% filter(cond==c1|cond==c2|cond==c3)
fm31<-fm3 %>% filter(cond==c1|cond==c2|cond==c3)
d<-ggplot(TP3,aes(x=cond,y=plong,group=cond,color=cond))+
  geom_point(alpha=0.8,size=2.5)+
  geom_pointrange(data=fm31,aes(x=cond,y=inm3(ym3.fit),
                               ymin=inm3(ym3.fit-1.96*ym3.se.fit),
                               ymax=inm3((ym3.fit+1.96*ym3.se.fit)),
                               group=cond,color=cond),size=2,linewidth=3)+
  theme_classic() +
  labs(y="Diving events",x="")+
  theme(plot.title = element_text(hjust = 0.5))+
  theme(plot.title = element_text(size=20,face = "bold"))+
  theme(axis.text=element_text(size=20,color="black"),
        axis.title=element_text(size=20,color="black"))+
  scale_color_manual(values=c("#54C6CC","#FFD966","#F0B33E"))+
  theme(legend.title = element_text(size=20),
        legend.text = element_text(size=20))+
  guides(colour=guide_legend(title="Species"))+
  theme(legend.position = "none",
        strip.text = element_text(size = 20))+
  stat_compare_means(comparisons = list(
    c(c3,c1),c(c3,c2)),
    aes(label = ..p.signif..),
    bracket.size = 1,size=5)

ggarrange(a,b,c,d,labels = c("A", "B", "C","D"),
                    ncol = 2, nrow = 2)

4) Plot GLYPHOSATE –> Figure S2

Ta4<-Ta2 %>% filter(cond==c6|cond==c4|cond==c5)
fm12<-fm1 %>% filter(cond==c6|cond==c4|cond==c5)
a<-ggplot(Ta4,aes(x=cond,y=absdY,group=cond,color=cond))+
  geom_point(alpha=0.8,size=2.5)+
  geom_pointrange(data=fm12,aes(x=cond,y=inm1(ym1.fit),
                               ymin=inm1(ym1.fit-1.96*ym1.se.fit),
                               ymax=inm1((ym1.fit+1.96*ym1.se.fit)),
                               group=cond,color=cond),size=2,linewidth=3)+
  labs(y="Average speed (mm/sec)",x="")+
  theme_classic() +
  theme(plot.title = element_text(hjust = 0.5))+
  theme(plot.title = element_text(size=20,face = "bold"))+
  theme(axis.text=element_text(size=20,color="black"),
        axis.title=element_text(size=20,color="black"))+
  scale_color_manual(values=c("#54C6CC","#EB8176","#941100"))+
  theme(legend.title = element_text(size=20),
        legend.text = element_text(size=20))+
  guides(colour=guide_legend(title="Species"))+
  theme(legend.position = "none",
        strip.text = element_text(size = 20))+
  stat_compare_means(comparisons = list(
    c(c4,c5),c(c4,c6)),
    aes(label = ..p.signif..),
    bracket.size = 1,size=5)

TZA4<-TZA %>% filter(cond==c6|cond==c4|cond==c5)
b<-ggplot(TZA4)+
  geom_point(aes(y=Zone,x=cond,size=spend,colour=cond))+
  theme_classic() +
  labs(y="Zones",x="")+
  theme(plot.title = element_text(hjust = 0.5))+
  theme(plot.title = element_text(size=20,face = "bold"))+
  theme(axis.text=element_text(size=20,color="black"),
        axis.title=element_text(size=20,color="black"))+
  scale_color_manual(values=c("#54C6CC","#EB8176","#941100"))+
  theme(legend.title = element_text(size=20),
        legend.text = element_text(size=20))+
  guides(colour=guide_legend(title="Species"))+
  theme(strip.text = element_text(size = 20))+
  scale_size(range = c(.1, 30), name="% Time spent")+
  guides(color = FALSE)+
  theme(legend.position='none')


iltf4<-iltf %>% filter(cond==c6|cond==c4|cond==c5)
fm22<-fm2 %>% filter(cond==c6|cond==c4|cond==c5)
c<-ggplot(iltf4,aes(x=cond,y=tmov,group=cond,color=cond))+
  geom_point(alpha=0.8,size=2.5)+
  geom_pointrange(data=fm22,aes(x=cond,y=inm2(ym2.fit),
                               ymin=inm2(ym2.fit-1.96*ym2.se.fit),
                               ymax=inm2((ym2.fit+1.96*ym2.se.fit)),
                               group=cond,color=cond),size=2,linewidth=3)+
  theme_classic() +
  labs(y="Time spent moving (%)",x="")+
  theme(plot.title = element_text(hjust = 0.5))+
  theme(plot.title = element_text(size=20,face = "bold"))+
  theme(axis.text=element_text(size=20,color="black"),
        axis.title=element_text(size=20,color="black"))+
  scale_color_manual(values=c("#54C6CC","#EB8176","#941100"))+
  theme(legend.title = element_text(size=20),
        legend.text = element_text(size=20))+
  guides(colour=guide_legend(title="Species"))+
  theme(legend.position = "none",
        strip.text = element_text(size = 20))+
  stat_compare_means(comparisons = list(
    c(c4,c5),c(c4,c6)),
    aes(label = ..p.signif..),
    bracket.size = 1,size=5)

TP4<-TP %>% filter(cond==c6|cond==c4|cond==c5)
fm32<-fm3 %>% filter(cond==c6|cond==c4|cond==c5)
d<-ggplot(TP4,aes(x=cond,y=plong,group=cond,color=cond))+
  geom_point(alpha=0.8,size=2.5)+
  geom_pointrange(data=fm32,aes(x=cond,y=inm3(ym3.fit),
                                ymin=inm3(ym3.fit-1.96*ym3.se.fit),
                                ymax=inm3((ym3.fit+1.96*ym3.se.fit)),
                                group=cond,color=cond),size=2,linewidth=3)+
  theme_classic() +
  labs(y="Diving events",x="")+
  theme(plot.title = element_text(hjust = 0.5))+
  theme(plot.title = element_text(size=20,face = "bold"))+
  theme(axis.text=element_text(size=20,color="black"),
        axis.title=element_text(size=20,color="black"))+
  scale_color_manual(values=c("#54C6CC","#EB8176","#941100"))+
  theme(legend.title = element_text(size=20),
        legend.text = element_text(size=20))+
  guides(colour=guide_legend(title="Species"))+
  theme(legend.position = "none",
        strip.text = element_text(size = 20))+
  stat_compare_means(comparisons = list(
    c(c4,c5),c(c4,c6)),
    aes(label = ..p.signif..),
    bracket.size = 1,size=5)

ggarrange(a,b,c,d,labels = c("A", "B", "C","D"),
                    ncol = 2, nrow = 2)

5) Plot PARACETAMOL –> Figure S3

Ta5<-Ta2 %>% filter(cond==c7|cond==c8|cond==c4)
fm13<-fm1 %>% filter(cond==c7|cond==c8|cond==c4)
a<-ggplot(Ta5,aes(x=cond,y=absdY,group=cond,color=cond))+
  geom_point(alpha=0.8,size=2.5)+
  geom_pointrange(data=fm13,aes(x=cond,y=inm1(ym1.fit),
                               ymin=inm1(ym1.fit-1.96*ym1.se.fit),
                               ymax=inm1((ym1.fit+1.96*ym1.se.fit)),
                               group=cond,color=cond),size=2,linewidth=3)+
  labs(y="Average speed (mm/sec)",x="")+
  theme_classic() +
  theme(plot.title = element_text(hjust = 0.5))+
  theme(plot.title = element_text(size=20,face = "bold"))+
  theme(axis.text=element_text(size=20,color="black"),
        axis.title=element_text(size=20,color="black"))+
  scale_color_manual(values=c("#54C6CC","#00A1EA","#0070C0"))+
  theme(legend.title = element_text(size=20),
        legend.text = element_text(size=20))+
  guides(colour=guide_legend(title="Species"))+
  theme(legend.position = "none",
        strip.text = element_text(size = 20))+
  stat_compare_means(comparisons = list(
    c(c4,c7),c(c4,c8)),
    aes(label = ..p.signif..),
    bracket.size = 1,size=5)

TZA5<-TZA %>% filter(cond==c4|cond==c7|cond==c8)
b<-ggplot(TZA5)+
  geom_point(aes(y=Zone,x=cond,size=spend,colour=cond))+
  theme_classic() +
  labs(y="Zones",x="")+
  theme(plot.title = element_text(hjust = 0.5))+
  theme(plot.title = element_text(size=20,face = "bold"))+
  theme(axis.text=element_text(size=20,color="black"),
        axis.title=element_text(size=20,color="black"))+
  scale_color_manual(values=c("#54C6CC","#00A1EA","#0070C0"))+
  theme(legend.title = element_text(size=20),
        legend.text = element_text(size=20))+
  guides(colour=guide_legend(title="Species"))+
  theme(strip.text = element_text(size = 20))+
  scale_size(range = c(.1, 30), name="% Time spent")+
  guides(color = FALSE)+
  theme(legend.position='none')

iltf5<-iltf %>% filter(cond==c7|cond==c8|cond==c4)
fm23<-fm2 %>% filter(cond==c7|cond==c8|cond==c4)
c<-ggplot(iltf5,aes(x=cond,y=tmov,group=cond,color=cond))+
  geom_point(alpha=0.8,size=2.5)+
  geom_pointrange(data=fm23,aes(x=cond,y=inm2(ym2.fit),
                               ymin=inm2(ym2.fit-1.96*ym2.se.fit),
                               ymax=inm2((ym2.fit+1.96*ym2.se.fit)),
                               group=cond,color=cond),size=2,linewidth=3)+
  theme_classic() +
  labs(y="Time spent moving (%)",x="")+
  theme(plot.title = element_text(hjust = 0.5))+
  theme(plot.title = element_text(size=20,face = "bold"))+
  theme(axis.text=element_text(size=20,color="black"),
        axis.title=element_text(size=20,color="black"))+
  scale_color_manual(values=c("#54C6CC","#00A1EA","#0070C0"))+
  theme(legend.title = element_text(size=20),
        legend.text = element_text(size=20))+
  guides(colour=guide_legend(title="Species"))+
  theme(legend.position = "none",
        strip.text = element_text(size = 20))+
  stat_compare_means(comparisons = list(
    c(c4,c7),c(c4,c8)),
    aes(label = ..p.signif..),
    bracket.size = 1,size=5)

TP5<-TP %>% filter(cond==c7|cond==c8|cond==c4)
fm33<-fm3 %>% filter(cond==c7|cond==c8|cond==c4)
d<-ggplot(TP5,aes(x=cond,y=plong,group=cond,color=cond))+
  geom_point(alpha=0.8,size=2.5)+
  geom_pointrange(data=fm33,aes(x=cond,y=inm3(ym3.fit),
                               ymin=inm3(ym3.fit-1.96*ym3.se.fit),
                               ymax=inm3((ym3.fit+1.96*ym3.se.fit)),
                               group=cond,color=cond),size=2,linewidth=3)+
  theme_classic() +
  labs(y="Diving events",x="")+
  theme(plot.title = element_text(hjust = 0.5))+
  theme(plot.title = element_text(size=20,face = "bold"))+
  theme(axis.text=element_text(size=20,color="black"),
        axis.title=element_text(size=20,color="black"))+
  scale_color_manual(values=c("#54C6CC","#00A1EA","#0070C0"))+
  theme(legend.title = element_text(size=20),
        legend.text = element_text(size=20))+
  guides(colour=guide_legend(title="Species"))+
  theme(legend.position = "none",
        strip.text = element_text(size = 20))+
  stat_compare_means(comparisons = list(
    c(c4,c7),c(c4,c8)),
    aes(label = ..p.signif..),
    bracket.size = 1,size=5)

ggarrange(a,b,c,d,labels = c("A", "B", "C","D"),
                    ncol = 2, nrow = 2)

6) Stats –> Supp Table T4

mH1<-lm(absdY~cond,data=Ta3)
simH1 <- simulateResiduals(fittedModel = mH1, plot = T)

Anova(mH1)
## Anova Table (Type II tests)
## 
## Response: absdY
##            Sum Sq Df F value   Pr(>F)   
## cond       191.33  2  5.1255 0.007797 **
## Residuals 1679.81 90                    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
emmeans(mH1, pairwise ~ cond,adjust="tukey")
## $emmeans
##  cond        emmean    SE df lower.CL upper.CL
##  Control N°1   9.24 0.741 90     7.77     10.7
##  A 200µg/L     8.76 0.789 90     7.20     10.3
##  A 500µg/L    12.08 0.802 90    10.49     13.7
## 
## Confidence level used: 0.95 
## 
## $contrasts
##  contrast                  estimate   SE df t.ratio p.value
##  Control N°1 - (A 200µg/L)    0.477 1.08 90   0.441  0.8985
##  Control N°1 - (A 500µg/L)   -2.843 1.09 90  -2.603  0.0288
##  (A 200µg/L) - (A 500µg/L)   -3.320 1.13 90  -2.951  0.0111
## 
## P value adjustment: tukey method for comparing a family of 3 estimates
mH2<-lm(tmov~cond,data=iltf3)
simH2 <- simulateResiduals(fittedModel = mH2, plot = T)

Anova(mH2)
## Anova Table (Type II tests)
## 
## Response: tmov
##            Sum Sq Df F value Pr(>F)
## cond       1064.1  2  2.2964 0.1065
## Residuals 20852.4 90
emmeans(mH2, pairwise ~ cond,adjust="tukey")
## $emmeans
##  cond        emmean   SE df lower.CL upper.CL
##  Control N°1   70.4 2.61 90     65.2     75.5
##  A 200µg/L     67.2 2.78 90     61.7     72.7
##  A 500µg/L     75.6 2.83 90     70.0     81.2
## 
## Confidence level used: 0.95 
## 
## $contrasts
##  contrast                  estimate   SE df t.ratio p.value
##  Control N°1 - (A 200µg/L)     3.17 3.81 90   0.832  0.6841
##  Control N°1 - (A 500µg/L)    -5.24 3.85 90  -1.362  0.3650
##  (A 200µg/L) - (A 500µg/L)    -8.41 3.96 90  -2.123  0.0909
## 
## P value adjustment: tukey method for comparing a family of 3 estimates
mH3<-lm(plong~cond,data=TP3)
simH3 <- simulateResiduals(fittedModel = mH3, plot = T)

Anova(mH3)
## Anova Table (Type II tests)
## 
## Response: plong
##            Sum Sq Df F value   Pr(>F)   
## cond       3408.9  2  5.4692 0.005733 **
## Residuals 28047.9 90                    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
emmeans(mH3, pairwise ~ cond,adjust="tukey")
## $emmeans
##  cond        emmean   SE df lower.CL upper.CL
##  Control N°1   33.7 3.03 90     27.7     39.7
##  A 200µg/L     32.2 3.22 90     25.8     38.6
##  A 500µg/L     46.0 3.28 90     39.5     52.5
## 
## Confidence level used: 0.95 
## 
## $contrasts
##  contrast                  estimate   SE df t.ratio p.value
##  Control N°1 - (A 200µg/L)     1.51 4.42 90   0.341  0.9381
##  Control N°1 - (A 500µg/L)   -12.29 4.46 90  -2.755  0.0193
##  (A 200µg/L) - (A 500µg/L)   -13.80 4.60 90  -3.002  0.0096
## 
## P value adjustment: tukey method for comparing a family of 3 estimates
mH1<-lm(absdY~cond,data=Ta4)
simH1 <- simulateResiduals(fittedModel = mH1, plot = T)

Anova(mH1)
## Anova Table (Type II tests)
## 
## Response: absdY
##            Sum Sq  Df F value Pr(>F)
## cond        51.14   2  1.0889 0.3405
## Residuals 2371.83 101
emmeans(mH1, pairwise ~ cond,adjust="tukey")
## $emmeans
##  cond        emmean    SE  df lower.CL upper.CL
##  Control N°2   11.3 0.731 101     9.85     12.7
##  G 100µg/L     12.0 0.885 101    10.22     13.7
##  G 200µg/L     10.2 0.885 101     8.40     11.9
## 
## Confidence level used: 0.95 
## 
## $contrasts
##  contrast                  estimate   SE  df t.ratio p.value
##  Control N°2 - (G 100µg/L)   -0.678 1.15 101  -0.591  0.8254
##  Control N°2 - (G 200µg/L)    1.144 1.15 101   0.997  0.5807
##  (G 100µg/L) - (G 200µg/L)    1.821 1.25 101   1.456  0.3166
## 
## P value adjustment: tukey method for comparing a family of 3 estimates
mH2<-lm(tmov~cond,data=iltf4)
simH2 <- simulateResiduals(fittedModel = mH2, plot = T)

Anova(mH2)
## Anova Table (Type II tests)
## 
## Response: tmov
##            Sum Sq  Df F value Pr(>F)
## cond        146.6   2  0.6518 0.5233
## Residuals 11357.8 101
emmeans(mH2, pairwise ~ cond,adjust="tukey")
## $emmeans
##  cond        emmean   SE  df lower.CL upper.CL
##  Control N°2   74.8 1.60 101     71.6     78.0
##  G 100µg/L     77.6 1.94 101     73.7     81.4
##  G 200µg/L     75.4 1.94 101     71.5     79.2
## 
## Confidence level used: 0.95 
## 
## $contrasts
##  contrast                  estimate   SE  df t.ratio p.value
##  Control N°2 - (G 100µg/L)   -2.804 2.51 101  -1.117  0.5059
##  Control N°2 - (G 200µg/L)   -0.594 2.51 101  -0.237  0.9696
##  (G 100µg/L) - (G 200µg/L)    2.211 2.74 101   0.807  0.6993
## 
## P value adjustment: tukey method for comparing a family of 3 estimates
mH3<-lm(plong~cond,data=TP4)
simH3 <- simulateResiduals(fittedModel = mH3, plot = T)

Anova(mH3)
## Anova Table (Type II tests)
## 
## Response: plong
##           Sum Sq  Df F value Pr(>F)
## cond        1393   2  1.8479 0.1629
## Residuals  38055 101
emmeans(mH3, pairwise ~ cond,adjust="tukey")
## $emmeans
##  cond        emmean   SE  df lower.CL upper.CL
##  Control N°2   41.7 2.93 101     35.9     47.5
##  G 100µg/L     46.4 3.54 101     39.4     53.4
##  G 200µg/L     36.8 3.54 101     29.7     43.8
## 
## Confidence level used: 0.95 
## 
## $contrasts
##  contrast                  estimate   SE  df t.ratio p.value
##  Control N°2 - (G 100µg/L)    -4.67 4.60 101  -1.017  0.5681
##  Control N°2 - (G 200µg/L)     4.96 4.60 101   1.079  0.5290
##  (G 100µg/L) - (G 200µg/L)     9.63 5.01 101   1.922  0.1377
## 
## P value adjustment: tukey method for comparing a family of 3 estimates
mH1<-lm(absdY~cond,data=Ta5)
simH1 <- simulateResiduals(fittedModel = mH1, plot = T)

Anova(mH1)
## Anova Table (Type II tests)
## 
## Response: absdY
##            Sum Sq  Df F value Pr(>F)
## cond        32.22   2  0.7107 0.4937
## Residuals 2312.02 102
emmeans(mH1, pairwise ~ cond,adjust="tukey")
## $emmeans
##  cond        emmean    SE  df lower.CL upper.CL
##  Control N°2   11.3 0.718 102     9.87     12.7
##  P 1mg/L       10.1 0.855 102     8.44     11.8
##  P 10mg/L      10.2 0.869 102     8.50     11.9
## 
## Confidence level used: 0.95 
## 
## $contrasts
##  contrast                 estimate   SE  df t.ratio p.value
##  Control N°2 - (P 1mg/L)    1.1644 1.12 102   1.043  0.5516
##  Control N°2 - (P 10mg/L)   1.0753 1.13 102   0.954  0.6076
##  (P 1mg/L) - (P 10mg/L)    -0.0891 1.22 102  -0.073  0.9971
## 
## P value adjustment: tukey method for comparing a family of 3 estimates
mH2<-lm(tmov~cond,data=iltf5)
simH2 <- simulateResiduals(fittedModel = mH2, plot = T)

Anova(mH2)
## Anova Table (Type II tests)
## 
## Response: tmov
##            Sum Sq  Df F value Pr(>F)
## cond        156.1   2  0.5586 0.5737
## Residuals 14250.0 102
emmeans(mH2, pairwise ~ cond,adjust="tukey")
## $emmeans
##  cond        emmean   SE  df lower.CL upper.CL
##  Control N°2   74.8 1.78 102     71.3     78.3
##  P 1mg/L       72.1 2.12 102     67.9     76.3
##  P 10mg/L      74.8 2.16 102     70.5     79.1
## 
## Confidence level used: 0.95 
## 
## $contrasts
##  contrast                 estimate   SE  df t.ratio p.value
##  Control N°2 - (P 1mg/L)    2.6541 2.77 102   0.958  0.6053
##  Control N°2 - (P 10mg/L)  -0.0458 2.80 102  -0.016  0.9999
##  (P 1mg/L) - (P 10mg/L)    -2.6998 3.03 102  -0.892  0.6467
## 
## P value adjustment: tukey method for comparing a family of 3 estimates
mH3<-lm(plong~cond,data=TP5)
simH3 <- simulateResiduals(fittedModel = mH3, plot = T)

Anova(mH3)
## Anova Table (Type II tests)
## 
## Response: plong
##           Sum Sq  Df F value Pr(>F)
## cond         511   2   0.733  0.483
## Residuals  35563 102
emmeans(mH3, pairwise ~ cond,adjust="tukey")
## $emmeans
##  cond        emmean   SE  df lower.CL upper.CL
##  Control N°2   41.7 2.81 102     36.1     47.3
##  P 1mg/L       37.4 3.35 102     30.8     44.1
##  P 10mg/L      37.1 3.41 102     30.3     43.9
## 
## Confidence level used: 0.95 
## 
## $contrasts
##  contrast                 estimate   SE  df t.ratio p.value
##  Control N°2 - (P 1mg/L)     4.308 4.38 102   0.984  0.5887
##  Control N°2 - (P 10mg/L)    4.627 4.42 102   1.047  0.5493
##  (P 1mg/L) - (P 10mg/L)      0.319 4.78 102   0.067  0.9975
## 
## P value adjustment: tukey method for comparing a family of 3 estimates